/*****************************************************************************
*        描述 :
*             文件描述
*        CLR版本:            3.5
*        创建者 :            蒋 光
*        个人域名:           jiangguang.net.cn
*        命名空间名称:       ECP.Interface
*        文件名:             AbstractServiceFactory.cs
*        创建系统时间:       2012/11/2 19:07:01
*        创建年份:           2012
*
/*****************************************************************************/

namespace ECP.Interface
{
    using System.Configuration;
    using System.Reflection;

    public abstract class AbstractServiceFactory
    {
        private static readonly string serviceFactoryClass = ConfigurationManager.AppSettings["ServiceFactory"];
        private static readonly string servicePath = ConfigurationManager.AppSettings["ServicePath"];

        public IServiceFactory GetServiceFactory()
        {
            return this.GetServiceFactory(servicePath);
        }

        public IServiceFactory GetServiceFactory(string servicePath)
        {
            return (IServiceFactory)Assembly.Load(servicePath).CreateInstance(serviceFactoryClass);
        }

        public IServiceFactory GetServiceFactory(string servicePath, string serviceFactoryClass)
        {
             ;
             return (IServiceFactory)Assembly.Load(servicePath).CreateInstance(serviceFactoryClass);
        }
    }
}